From f138b72d1ebecbbc5e8ca0eedde9a42d82d378eb Mon Sep 17 00:00:00 2001 From: Christian Limpach Date: Wed, 11 Apr 2007 23:05:07 +0100 Subject: [PATCH] [ioemu] Consistently extend all block device operations to include scsi disks. Signed-off-by: Christian Limpach --- tools/ioemu/monitor.c | 2 +- tools/ioemu/vl.c | 10 +++++----- tools/ioemu/vl.h | 2 +- tools/ioemu/xenstore.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/ioemu/monitor.c b/tools/ioemu/monitor.c index 5625ad06e0..2221421243 100644 --- a/tools/ioemu/monitor.c +++ b/tools/ioemu/monitor.c @@ -180,7 +180,7 @@ static void do_commit(void) { int i; - for (i = 0; i < MAX_DISKS; i++) { + for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { if (bs_table[i]) { bdrv_commit(bs_table[i]); } diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index 022684853b..6f5d34a992 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -116,7 +116,7 @@ char phys_ram_file[1024]; void *ioport_opaque[MAX_IOPORTS]; IOPortReadFunc *ioport_read_table[3][MAX_IOPORTS]; IOPortWriteFunc *ioport_write_table[3][MAX_IOPORTS]; -BlockDriverState *bs_table[MAX_DISKS+MAX_SCSI_DISKS], *fd_table[MAX_FD]; +BlockDriverState *bs_table[MAX_DISKS + MAX_SCSI_DISKS], *fd_table[MAX_FD]; int vga_ram_size; int bios_size; static DisplayState display_state; @@ -1396,7 +1396,7 @@ static void stdio_received_byte(int ch) case 's': { int i; - for (i = 0; i < MAX_DISKS; i++) { + for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { if (bs_table[i]) bdrv_commit(bs_table[i]); } @@ -6057,7 +6057,7 @@ int main(int argc, char **argv) int snapshot, linux_boot; const char *initrd_filename; #ifndef CONFIG_DM - const char *hd_filename[MAX_DISKS]; + const char *hd_filename[MAX_DISKS + MAX_SCSI_DISKS]; #endif /* !CONFIG_DM */ const char *fd_filename[MAX_FD]; const char *kernel_filename, *kernel_cmdline; @@ -6126,7 +6126,7 @@ int main(int argc, char **argv) for(i = 0; i < MAX_FD; i++) fd_filename[i] = NULL; #ifndef CONFIG_DM - for(i = 0; i < MAX_DISKS; i++) + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) hd_filename[i] = NULL; #endif /* !CONFIG_DM */ ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; @@ -6724,7 +6724,7 @@ int main(int argc, char **argv) } /* open the virtual block devices */ - for(i = 0; i < MAX_DISKS; i++) { + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { if (hd_filename[i]) { if (!bs_table[i]) { char buf[64]; diff --git a/tools/ioemu/vl.h b/tools/ioemu/vl.h index 175fbab2ad..7f90b2cb70 100644 --- a/tools/ioemu/vl.h +++ b/tools/ioemu/vl.h @@ -820,7 +820,7 @@ int vnc_start_viewer(int port); #define MAX_DISKS 4 #define MAX_SCSI_DISKS 7 -extern BlockDriverState *bs_table[MAX_DISKS+MAX_SCSI_DISKS]; +extern BlockDriverState *bs_table[MAX_DISKS + MAX_SCSI_DISKS]; void isa_ide_init(int iobase, int iobase2, int irq, BlockDriverState *hd0, BlockDriverState *hd1); diff --git a/tools/ioemu/xenstore.c b/tools/ioemu/xenstore.c index e369c5b519..c3ee11b19c 100644 --- a/tools/ioemu/xenstore.c +++ b/tools/ioemu/xenstore.c @@ -18,7 +18,7 @@ #include static struct xs_handle *xsh = NULL; -static char *media_filename[MAX_DISKS]; +static char *media_filename[MAX_DISKS + MAX_SCSI_DISKS]; static QEMUTimer *insert_timer = NULL; #define UWAIT_MAX (30*1000000) /* thirty seconds */ @@ -44,7 +44,7 @@ static void insert_media(void *opaque) { int i; - for (i = 0; i < MAX_DISKS; i++) { + for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) { if (media_filename[i] && bs_table[i]) { do_change(bs_table[i]->device_name, media_filename[i]); free(media_filename[i]); @@ -86,7 +86,7 @@ void xenstore_parse_domain_config(int domid) int i, is_scsi; unsigned int len, num, hd_index; - for(i = 0; i < MAX_DISKS; i++) + for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) media_filename[i] = NULL; xsh = xs_daemon_open(); -- 2.30.2